  <div class="padding-all">
	  <div ng-include src="'/ksr/partials/breadcrumb.htm'"></div>
	
	<div class="panel panel-default">
	  <div class="panel-heading">
	    <h3 class="panel-title capitalize">
	    	Edit Subscription for event <span class="font-orange">{{subscription.eventSchedule.event.eventName}}</span>
    	</h3>
	  </div>
	  <div class="panel-body">
		<form role="form" name = "subscrForm" class="ksr-form" ng-submit="subscrForm.$valid&&submit()" novalidate>
			
			<div class="error alert alert-danger pull-left" ng-show="submitted&&subscrForm.subscriptionType.$error.required">
		    	<span class="glyphicon glyphicon-warning-sign"></span> Subscription type is required
	    	</div>
	    	<div class="clearfix"></div>
		  	<div class="input-group input-group-lg margin-bottom">
			  <span class="input-group-addon">Type</span>
			  <input type="text" class="form-control" name="subscriptionType" ng-model="subscription.subscriptionType" ng-required="true" placeholder="Enter subscription type"/>
			</div>
			<div class="clearfix"></div>

			<div class="error alert alert-danger pull-left" ng-show="submitted&&subscrForm.startDate.$error.required">
		    	<span class="glyphicon glyphicon-warning-sign"></span> Start Date is required
	    	</div>
	    	<div class="clearfix"></div>
		  	<div class="input-group input-group-lg margin-bottom">
			  <span class="input-group-addon">Start Date</span>
			  <input type="date" class="form-control" name="startDate" ng-model="subscription.startDate" placeholder="Enter start date" ng-required="true" min="{{subscription.eventSchedule.startDate}}" max="{{subscription.eventSchedule.endDate}}"/>
			</div>
			<div class="clearfix"></div>

			<div class="error alert alert-danger pull-left" ng-show="submitted&&subscrForm.endDate.$error.required">
		    	<span class="glyphicon glyphicon-warning-sign"></span> End Date is required
	    	</div>
	    	<div class="clearfix"></div>
		  	<div class="input-group input-group-lg margin-bottom">
			  <span class="input-group-addon">End Date</span>
			  <input type="date" class="form-control" name="endDate" ng-model="subscription.endDate" placeholder="Enter end date" ng-required="true" min="{{subscription.eventSchedule.startDate}}" max="{{subscription.eventSchedule.endDate}}"/>
			</div>
			<div class="clearfix"></div>

			<div class="error alert alert-danger pull-left" ng-show="submitted&&subscrForm.openingTime.$error.required">
		    	<span class="glyphicon glyphicon-warning-sign"></span> Open Time is required
	    	</div>
	    	<div class="clearfix"></div>
		  	<div class="input-group input-group-lg margin-bottom">
			  <span class="input-group-addon">Open Time</span>
			  <input type="time" class="form-control" name="openingTime" ng-model="subscription.openingTime" placeholder="HH:mm:ss" required min="{{subscription.eventSchedule.openingTime}}" max="{{subscription.eventSchedule.closingTime}}" />
			</div>
			<div class="clearfix"></div>


			<div class="error alert alert-danger pull-left" ng-show="submitted&&subscrForm.closingTime.$error.required">
		    	<span class="glyphicon glyphicon-warning-sign"></span> Close Time is required
	    	</div>
	    	<div class="clearfix"></div>
		  	<div class="input-group input-group-lg margin-bottom">
			  <span class="input-group-addon">Close Time</span>
			  <input type="time" class="form-control" name="closingTime" ng-model="subscription.closingTime" placeholder="HH:mm:ss" required=true min="{{subscription.eventSchedule.openingTime}}" max="{{subscription.eventSchedule.closingTime}}" />
			</div>
			<div class="clearfix"></div>

			<div class="panel panel-default">
			  <!-- Default panel contents -->
			  <div class="panel-heading">Address</div>
			  

			  <!-- List group -->
			  <ul class="list-group">
			    <li class="list-group-item" ng-repeat="add in subscription.eventSchedule.eventAddresses">
			    	<div class="radio">
			  			<label>
			    			<input type="radio" name="address" ng-model="subscription.address.id" ng-value="add.id" ng-change="selectAddress(add.id)"/>
		    				<span>{{add.addressLine1}}</span>, 
					    	<span ng-if="add.addressLine2">{{add.addressLine2}}</span>
					    	<span>{{add.city}}</span>
					    	<span>{{add.state}}</span>
					    	<span>{{add.zip}}</span>
						  </label>
					</div>
			    </li>
			  </ul>
			</div>
		  
		  <button type="submit" ng-click="submitted=true" class="btn btn-primary">Submit</button>
		  <a  ng-href="#/overview" class="btn btn-default">Cancel</a>
		</form>
	  </div>
	</div>
	
	<!-- 
	 -->
	<pre ng-bind="subscription | json"></pre>
 </div>